<template>
    <h1>登录列表</h1>

    <table class="table table-bordered" border="1">
        <thead>
            <tr>
                <th>用户编号</th>
                <th>用户名</th>
                <th>密码</th>
                <th>用户登录时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in User" >
                <td>{{ item.UL_Id }}</td>
                <td>{{ item.UL_Name }}</td>
                <td>******</td>
                <td>{{ item.UL_Date.replace('T',' ').substring(0,10) }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">

import {ref,onMounted} from 'vue'
import axios from 'axios'

const User = ref([{
    UL_Id:'',
    UL_Name:'',
    UL_Pwd:'',
    UL_Date:'',
    
}])

// 显示登录列表
onMounted(()=>{
  axios({
    url:'http://localhost:62058/api/User/ShowUser',
    method:'get',
  })  
  .then(res=>{
    User.value = res.data
  })
  .catch(err=>{
    console.log(err)
  })
})

</script>